<?php
class general {// create by zx


	function __construct() {
			global $admin;
	}
	
	
	function index() {
			global $db, $smarty, $config, $segment, $admin;
	}
	
	function modify(){
		global $db, $smarty, $config, $segment, $admin;
		if(empty($_POST['id'])){
			//create
			if (!$setting_admin=$_POST['setting_admin']){
				$setting_admin=$_SESSION['ADMIN_USER'];
			}
			$sqlstr = "insert into {$config->db_prefix}general (admin_name, create_user, shopid) value ('{$setting_admin}', '{$_SESSION['ADMIN_USER']}', '{$_POST['shopid']}')";
			$result = $db->execute($sqlstr);
		}else{
			
			$sqlstr = "update {$config->db_prefix}general set shopid ='{$_POST['shopid']}' where id = '{$_POST['id']}' limit 1";
			$result = $db->execute($sqlstr);
			
		}
		if($result) header("location:".(empty($_POST["referer"])?"{$config->site_admin}main_index.php":$_POST["referer"]));
				
	}
	
}